<%--
 *  File:    ColumnAutoUpdateEdit.jsp
 *  @Author: Jamesli 
 *  Date:    2011/01/20
 *
 *  Copyright (C) 2000 - 2011 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<% //--------------------------------------  setting logger --%>
<%
  	Category cat = Category.getInstance("jsp.ColumnAutoUpdateEdit");    
%>

<% //--------------------------------------  variant and initialization --%>
<%
  	String strModuleName = "COM";
  	String privilegeCode = "Z0832";
    String contextPath = request.getContextPath();
%>

<% //--------------------------------------  include files list --%>
<%@ include file="/inc/Security.inc" %>
<%@ include file="/inc/PageDefault.inc" %>

<html>
<head>
<title>ColumnAutoUpdateEdit</title>
<PageFlow:CheckPageFlow pageName="p_columnautoupdateedit"/>  
<%@ include file="/inc/CatchError.inc" %>
<%@ include file="/inc/InitEdit.inc" %>

<% //--------------------------------------  output variant from pageflow --%>
<%
	boolean readOnly = false;
	HashMap columnautoupdateinfo = (HashMap)pageContext.getAttribute("columnautoupdateinfo");
	if(null != columnautoupdateinfo) readOnly = true;
%>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%= contextPath%>/css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="<%= contextPath%>/js/ScriptLib.js"></script>
<script language="JavaScript">
function page_done()
{ 
  	if(!checkForm(document.cform)) return;
  	document.cform.actionname.value = "done";
  	isRunning = true;
  	cform.target = "_parent";
  	document.cform.submit();
}

function page_getnewvalues(){
	var analyzecodeid = cform.analyzecodeid.value;
	var columnname = cform.columnname.options[cform.columnname.selectedIndex].value;

  	if(isEmpty(analyzecodeid) || isEmpty(columnname)){
  		cform.newvalue.options.length = 0;
  		cform.newvalue.options[0]= new Option ('-------','');
  		return;
  	}

    var  datahandler = new  DataHandler() ;
    datahandler.add_params("analyzecodeid" , analyzecodeid) ;
    datahandler.add_params("columnname" , columnname) ;
    datahandler.getResultFromVector("newvalues" ,"showname" ,"newvalue" ,"document.cform.newvalue");
    datahandler.add_job("j_getnewvaluesbytablencolumn");
    datahandler.runDataHandler ();
}
</script>
</head>

<body>
<iframe id="reloadHandler" name="reloadHandler" style="display:none"></iframe>
	<% //--------------------------------------  hidden form variant --%>
	<form name="cform" method="post" action="<%= contextPath%>/Dispatcher" target="_parent">
    <input type="hidden" name="pagename" value="p_columnautoupdateedit">
    <input type="hidden" name="actionname">
    <custom:hidden property="analyzecodeid"/>
    <custom:hidden property="columnautoupdateid" name="columnautoupdateinfo"/>
	<table width="100%" cellspacing="0" border="0" cellpadding="0">
  	<tr> 
    	<td> 
      		<table width="100%" cellspacing="0" cellpadding="0">
        	<tr> 
          		<td colspan="2" class="summary_top"></td>
        	</tr>
        	<tr> 
          		<td colspan="2"><img src="<%= contextPath%>/images/<%= strLanguageCode %>/quote.gif" width="16" height="11"> 
            		<%= label.getLabelName("L_NewOrEdit") + label.getLabelName("L_Colon") %></td>
        	</tr>
      		</table>
      		
      		<table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">
        	<tr> 
          		<td class="need" width="15%"><%= label.getLabelName("L_Code") + label.getLabelName("L_Colon") %></td>
          		<td width="35%">
            		<custom:text property="columnautoupdatecode" name="columnautoupdateinfo" command="notnull" label="L_Code" readonly="<%= readOnly %>"/>
          		</td>
          		<td class="need" width="15%"><%= label.getLabelName("L_Name") + label.getLabelName("L_Colon") %></td>
          		<td width="35%">
          			<custom:text property="columnautoupdatename" name="columnautoupdateinfo" command="notnull" label="L_Name" readonly="<%= readOnly %>"/>
          		</td>
        	</tr>
        	<tr> 
          		<td class="need"><%= label.getLabelName("L_UpdateColumn") + label.getLabelName("L_Colon") %></td>
          		<td> 
          			<custom:select optionInnerTextKey="columnname" optionsName="columns" property="columnname" name="columnautoupdateinfo" optionValueKey="columnname" defaultValue="----------" defaultValueCost="" onchange="page_getnewvalues()" command="notnull"/>
          		</td>
          		<td class="need"><%= label.getLabelName("L_ColumnValue") + label.getLabelName("L_Colon") %></td>
          		<td>
          			<custom:select optionInnerTextKey="showname" optionsName="newvalues" property="newvalue" name="columnautoupdateinfo" optionValueKey="newvalue" defaultValue="------------" defaultValueCost="" command="notnull" label="L_ColumnValue"/>
          		</td>
        	</tr>
        	<tr> 
          		<td class="need"><%= label.getLabelName("L_Priority") + label.getLabelName("L_Colon") %> </td>
          		<td>
          			<custom:text property="priority" name="columnautoupdateinfo" dataType="integer" command="notnull" label="L_Priority"/> 
          		</td>
          		<td>&nbsp;</td>
          		<td>&nbsp;</td>
        	</tr>
        	</table>
    	</td>
  	</tr>
  	<tr> 
    	<td class="summary_top"></td>
  	</tr>
  	<tr> 
    	<td class="td_center"><a onclick="page_done()"><custom:button type="1" label="L_Finish" imgsrc="finish.gif" border="0" style="width:60"/></a></td>
  	</tr>
	</table>
</form>
</body>
</html>


